package com.ithuang.websocket.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ithuang.websocket.service.messageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
@Controller
@ResponseBody
public class messageController {
        @Autowired
   private messageService messageService;
    @RequestMapping("/p")

    public Object getMessage(int current,int size){
        IPage page= new Page(current,size);
        System.out.println(current+"         "+size);



        return messageService.page(page);


    }

}
